Skip to content

ci: trim PR Verify matrix to Node 24 and skip heavy jobs on docs-only PRs - #232

Merged
ScriptedAlchemy merged 2 commits into
mainfrom
ci/speedup
Sep 1, 2026
Merged

ci: trim PR Verify matrix to Node 24 and skip heavy jobs on docs-only PRs#232
ScriptedAlchemy merged 2 commits into
mainfrom
ci/speedup

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

Data-driven CI speedup, measured from 8 sampled runs today (per-job/per-step timings via the Actions API):

Job Median compute Dominant step
Verify (Node 22.19.0) 6.8 min pnpm test ~6.2 min
Verify (Node 24) 6.6 min pnpm test ~5.9 min
Verify (Node 26) 6.8 min pnpm test ~6.0 min
Examples check 3.9 min pnpm examples:check ~3.5 min
Release gates 3.0 min pnpm check:release:ci ~2.7 min
RSC runtime micro-eval 38 s pnpm eval:spot ~18 s
Dependency review 8 s

The 3-leg Verify matrix was ~21 of ~28 runner-minutes per PR, and the starved runner pool queued today's main pushes 20–27 minutes before the first job started (28–47 min wall for ~7 min of work).

Changes:

  • PR Verify matrix → Node 24 only (newest LTS the repo supports; Node 26 is Current until Oct 2026). Pushes to main and workflow_dispatch keep the full 22.19/24/26 matrix — main coverage is unchanged. The PR check name Verify (Node 24) already exists today; no branch protection or rulesets reference check names (verified: none configured).
  • Docs-only PRs skip the four heavy jobs via a new fail-open changes job (GitHub API file listing, no checkout). Docs-only = docs/**, agent-patterns/**, .changeset/*.md, top-level *.md. Nested markdown stays code (compiled SKILL.md artifacts, npm pack audits). The changes job is skipped on push, and !cancelled() gating means main jobs start immediately — zero added latency on main.
  • docs/local-ci.md updated (stale ~13–16 min figure, PR-vs-main matrix split, docs-only skip). The local gate keeps all three Node legs since local green must prove what the post-merge main run proves.

Deliberately NOT done (data says already solved or not worth it):

  • pnpm store caching, Chrome/Playwright caching: already in place (pnpm/setup cache + runner-image Chrome; install ~3s, Chrome check <5s).
  • Build-output caching: pnpm build is ~10s.
  • Test sharding: would add job-count overhead to an already starved runner pool.
  • Concurrency: PR-cancel already works (verified on a real force-push pair); main stays SHA-keyed no-cancel by design.

Expected effect: ~28 → ~15 runner-minutes per PR (−47%), which also shrinks the queue that is inflating main push wall times.

Test plan

  • YAML parse + per-job if/needs semantics table verified locally
  • Docs-only classifier case logic tested against sample file lists (nested SKILL.md → code, changeset config → code, mixed → code)
  • This PR's own CI run demonstrates the trimmed matrix (single Verify (Node 24) leg) with all gates green

…only PRs

Measured across 8 runs today: the 3-leg Verify matrix (~7 min/leg, dominated
by pnpm test) was ~75% of a PR's ~28 runner-minutes, and the starved runner
pool queued main pushes 20-27 minutes. PRs now run a single Verify leg on
Node 24 (newest supported LTS); pushes to main and workflow_dispatch keep the
full 22.19/24/26 matrix, so main coverage is unchanged. Docs-only PRs
(docs/**, agent-patterns/**, .changeset/*.md, top-level *.md) skip the four
heavy jobs via a fail-open API-based classifier; nested markdown stays code
because compiled SKILL.md artifacts and package markdown affect npm pack
audits. pnpm store caching, Chrome reuse, and PR-cancel concurrency were
already in place and are untouched.
@changeset-bot

changeset-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f7e94b9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T23:16:39.590526Z e343e32 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Sep 1, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@232
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@232
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@232

commit: e343e32

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e343e32480

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml Outdated
files_file="$(mktemp)"
trap 'rm -f "$files_file"' EXIT
if ! gh api "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/files" \
--paginate --jq '.[].filename' > "$files_file"; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include source paths when classifying renames

When a PR renames a file from examples/** or another code path into docs/**, GitHub’s List pull request files response places the destination in filename and the source in previous_filename, but this selector discards the latter. The loop consequently labels the PR docs-only and skips Examples check, Verify, Release gates, and micro-eval even though source was removed; classify both paths or fail open on renamed entries.

AGENTS.md reference: AGENTS.md:L12-L14

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f7e94b9 — the files listing now emits .filename plus .previous_filename // empty per entry, and every emitted path goes through the allowlist, so a rename out of examples/** (or any code path) into docs/** classifies as code and runs the full checks. Verified with a local fixture harness: docs/new.md ← examples/skills-starter/SKILL.md → not docs-only; docs/a.md ← docs/b.md → still docs-only.

Comment thread .github/workflows/ci.yml Outdated
Comment on lines +50 to +51
if ! gh api "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/files" \
--paginate --jq '.[].filename' > "$files_file"; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fail open when the files endpoint truncates

For a PR changing more than 3,000 files, --paginate cannot make this classification complete because GitHub’s List pull request files endpoint caps responses at 3,000 files. If the returned subset is allowlisted while an omitted file is code, docs_only becomes true and every heavy check is skipped; compare the number returned with the PR’s changed_files count and fail open on a mismatch.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f7e94b9 — the script now fetches the PR's authoritative changed_files count first (fail-open if that call fails or returns a non-number) and compares it against the number of listed file entries; any mismatch (including the 3000-entry listing cap) logs Listed X of Y changed files and fails open to docs_only=false. Verified in the fixture harness (2 listed of 7 → not docs-only).

Review fixes: renamed files now contribute both their old and new paths to
the docs-only classifier (a code-to-docs rename no longer skips Verify), and
the listing is checked against the PR's authoritative changed_files count so
a truncated files API response (3000-entry cap) fails open to running every
heavy job.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant